package com.huawei.faketaobao.constant

object IConstant {
    //默认字体 大
    const val textSizeBig = 50f

    //默认字体 小
    const val textSizeSmall = 40f

    //移动速度-基本速度 调整基本速度即可调整整体速度
    const val moveSpeedBase = 5

    //速度为基本速度加上选择的速度等级  默认3级
    const val moveSpeed = 3 + moveSpeedBase

    //弹幕默认总开关
    const val danmuSwitch = true

    //弹幕最大通道数
    const val maxLevel = 4
    const val defaultLevel = 3

    //弹幕可调节的透明度
    const val textApl = 204
    //透明度的1%数值
    const val aplItem = 255f / 100f

    //基础的20%不可调节透明度 (80%为可调节的透明度)
    const val textBaseApl = 51

    //字体默认0.大  1.小
    const val defaultFontSize = 0;
    const val defaultFontColor = "#FFFFFF";

    //字体基础缩放值
    const val textSizeChangeBase = 0.7f
    //默认正常缩放字体 默认为3级1f 不缩放
    const val textSizeChange = 0.3f + textSizeChangeBase

    //网络配置相关
    const val TimeOut = 10 * 1000L
    const val AppType = "dy"
    const val CodeSuccess = 200
    const val ip = "192.168.0.42" //ip地址
    const val socketPort = 6600 //ip地址
    const val postPort = 8089 //ip地址
    const val PostUrl = "https://" + ip + ":" + postPort

}

/**
 * socket消息
 */
object SocketMsg {
    //收到实时弹幕
    const val receiveBarrage = "receiveBarrage"
    //账号异地登录
    const val KickOut = "KickOut"

}

object SPConstant {
    const val UserAccount = "UserAccount"
    const val UserPwd = "UserPwd"

    ////本地播放/////
    //弹幕开关
    const val danmuSwitch = "danmuSwitch"

    //弹幕透明度
    const val danmuAlpha = "danmuAlpha"

    //键盘弹出高度
    const val keyHeight = "keyHeight"

    //字体缩放大小
    const val textSizeChange = "textSizeChange"

    //最多通道
    const val maxLevel = "maxLevel"

    //移动速度
    const val moveSpeed = "moveSpeed"

    /////发送弹幕////
    //发送弹幕字体默认大小 0.大  1.小
    const val fontSize = "fontSize"

    //弹幕颜色
    const val textColor = "textColor"
}

object BundleConstant {
    const val AllStreamingResult = "AllStreamingResult"
}

/**
 * 弹幕设置的文案
 */
object DMSettingText {
    fun getSpeedText(level: Int): String {
        return when (level) {
            1 -> "慢"
            2 -> "较慢"
            3 -> "适中"
            4 -> "较快"
            5 -> "快"
            else -> {
                "适中"
            }
        }
    }

    fun getFontText(level: Int): String {
        return when (level) {
            1 -> "小号"
            2 -> "较小"
            3 -> "适中"
            4 -> "较大"
            5 -> "大号"
            else -> {
                "适中"
            }
        }
    }

    fun getColorList():List<String>{
        return ArrayList<String>().apply {
            add("#FFFFFF")
            add("#ED0013")
            add("#FEF204")
            add("#019843")
            add("#01A0EB")
            add("#E40080")
            add("#90C221")
            add("#002F72")
            add("#F0A92E")
            add("#693A7C")
            add("#85C0CD")
            add("#8D7338")
        }
    }

}